package com.gitee.feizns.quickstart.ding.talk.spring.boot.autoconfigure.db.mybatis.flex.pojo;

import com.gitee.feizns.quickstart.ddl.annotation.Comment;
import com.gitee.feizns.quickstart.domain.Types;
import com.gitee.feizns.quickstart.mybatis.flex.jpa.NumberIdPojo;
import com.gitee.feizns.quickstart.mybatis.flex.jpa.TreePojo;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;

/**
 * 部门
 * （参考钉钉系统：<a href="https://open.dingtalk.com/document/orgapp/query-department-details0-v2">部门详情接口</a>）
 * @author feizns
 * @since 2025/3/11
 */
@Data
@Entity
@Comment("部门")
@EqualsAndHashCode(callSuper = true)
public class DdDept extends NumberIdPojo<DdDept> implements TreePojo<DdDept, Long> {

    /**
     * 钉钉部门ID
     */
    @Comment("钉钉部门ID")
    @Column(unique = true)
    private Long deptId;

    /**
     * 部门名称
     */
    @Comment("部门名称")
    private String name;

    /**
     * 父编号
     */
    @Comment("父编号")
    @Column(columnDefinition = Types.BIGINT_UNSIGNED)
    private Long parentId;

}
